home *** CD-ROM | disk | FTP | other *** search
- Path: mystical.xs4all.nl!arcade
- Subject: Re: LoadRGB32()
- Newsgroups: comp.sys.amiga.programmer
- References: <4csqtl$ob3@rock101.genie.net>
- Distribution: world
- Organization: The AmigOS Project
- X-AmigOS-is-cool: TRUE
- X-Newsreader: TIN [AMIGA 1.3 950726BETA PL0]
- From: arcade@mystical.xs4all.nl (Pascal Eeftinck)
- Message-ID: <arcade.01g7@mystical.xs4all.nl>
- Date: Fri, 19 Jan 96 15:58:41 +0100
-
- IAN J. EINMAN (i.einman@genie.com) wrote:
- > dc.l r, g, b, ... (left justifies fraction)
- >
- > repeat this as much as necessary; terminate with a count value of
- > zero.
- >
- > For example:
- >
- > unsigned long junk[] =
- > {
- > 2<<16 | 4,
- > 0xFFFFFFFF, 0x7FFFFFFF, 0x00000000,
- > 0x00000000, 0x00000000, 0xA0000000,
- > 0
- > }
- >
- > LoadRGB32(viewp, junk);
-
- If you want to do it right, you'll do this:
-
- unsigned long junk[] =
- {
- 2<<16 | 4,
- 0xFFFFFFFF, 0x7F7F7F7F, 0x00000000,
- 0x00000000, 0x00000000, 0xA0A0A0A0,
- 0
- }
-
- Where the colors represent their actual correct value as they should
- be according to the autodocs.
-
- > will make color 4 be orange and color 5 be blue... The left
- > justified fraction is importand, just shift the colors over three
- > bytes if they are 8 bit descriptors like such found in an IFF ILBM.
-
- Wrong -> duplicate the amount of bits you have as long as you have
- bits to put them in.
-
- Divide $F into 15 equal steps, you'll get $1 for each step.
- Divide $FF into 15 equal steps, you'll get $11 for each step.
- Divide $FFFFFFFF into 15 equal steps, you'll get $11111111 for each
- step.
-
- All of the examples above have the same amount of steps. But all
- values are as well the maximum number you could put into those bits.
- Maximum brightness remains $F or $FFFFFFFF depending on the amount
- of bits you have available. Total darkness remains $0 (or $0000000).
- And when you take half of $FFFFFFFF to get half brightness,
- you'll get $7F7F7F7F, not $7FFFFFFF.
-
- I know these are small differences, but if you try to make it right
- then there's little use not doing so, right?
- --
- __
- /// Pascal Eeftinck -- C/C++ and Assembler Programmer -- Unix Freak
- /// AmigOS Project Coordinator -- GFX Freak -- Nick on IRC: Arcade
- __ /// arcade@mystical.xs4all.nl -- pascalee@amigos.telesys-innov.fr
- \\\/// $$$ <A HREF="http://www.xs4all.nl/~arcade/">My homepage</A> $$$
- \\\/ Fight the right for privacy! -- finger arcade@xs4all.nl for PGP key
-
-